﻿using System;
using fastCSharp;

namespace diantou.web
{
    /// <summary>
    /// 今日问题
    /// </summary>
    [fastCSharp.code.cSharp.webView(IsPool = true, IsReferer = false)]
    partial class today : view<today>
    {
        /// <summary>
        /// 分页路径
        /// </summary>
        private static string pagePath = diantou.dataModel.path.pub.Default.TodayQuestion + "?";
        /// <summary>
        /// 今日问题集合
        /// </summary>
        [fastCSharp.emit.webView.clearMember]
        private question.userQuestion[] questions;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="page"></param>
        /// <returns></returns>
        private bool loadView(int page)
        {
            diantou.dataAccess.question[] values = diantou.dataAccess.clientCache.Question.Get(diantou.dataAccess.tcpCall.question.allIds(pageInfo.Size = fastCSharp.config.pub.Default.PageSize, pageInfo.Page = page, out pageInfo.Count));
            questions = values.getArray(value => new question.userQuestion { Question = value, UserId = currentUserId });
            if (requestHeader.IsSearchEngine) pageInfo.Path = pagePath;
            return true;
        }
    }
}
